package AccountWindow.Customer;

import AccountWindow.HotelAdmin.HotelAdminWindow;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class CustomerWindowHandler implements ActionListener {
    private CustomerWindow customerWindow;
    public CustomerWindowHandler(CustomerWindow customerWindow) {
        this.customerWindow = customerWindow;
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        System.out.println("actiondCommand=" + actionCommand);

        try {
            if ("roomDetail".equals(actionCommand)) {
                customerWindow.cardLayout.show(customerWindow.customerPanel, "roomDetailPanel");
            }else if ("personalDetail".equals(actionCommand)) {
                customerWindow.cardLayout.show(customerWindow.customerPanel, "personalDetailPanel");
            }
        } catch (Exception error) {
            error.printStackTrace();
        }
    }
}
